<?php

namespace app\common\model\Business;

// 引入TP基础模型
use think\Model;

// 用户消费记录模型
class  Record extends Model
{
    // 设置当前模型对应的数据表名称
    protected $name = 'business_record';

    protected $autoWriteTimestamp = true;

    protected $createTime = 'createtime';

    protected $updateTime = false;

    protected $append = [
        'createTime_text'
    ];

    public function getCreateTimeTextAttr($value, $data)
    {
        return date('Y-m-d H:i:s', $data['createtime']);
    }
}